package com.inspur.his.controller;


import com.github.pagehelper.PageHelper;
import com.inspur.his.pojo.RoExt;
import com.inspur.his.service.RoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

@Controller
public class ypffListController {

    @Autowired
    private RoService roService;

    //药品分发模块功能
    @RequestMapping("ypffListController")
    public String drugsList(HttpServletRequest request, Model model, @RequestParam(value = "pn", defaultValue = "1") Integer pn){
        // 获取页面传递过来的查询条件
        String roid = request.getParameter("roid");
        String memberid = request.getParameter("memberid");
        String deptname = request.getParameter("deptname");
        String rotime = request.getParameter("rotime");

        HashMap map = new HashMap<String, String>();
        map.put("roid", roid);
        map.put("memberid", memberid);
        map.put("deptname", deptname);
        map.put("rotime", rotime);
        List<RoExt> roList = roService.roList(map);
        model.addAttribute("roList", roList);
        // 页面查询条件查询后锁定显示在页面上
        model.addAttribute("roid", roid);
        model.addAttribute("memberid", memberid);
        model.addAttribute("deptname", deptname);
        model.addAttribute("rotime", rotime);
        return "drugs/ypfflist.jsp";
    }




}
